﻿using System;
using System.Data.SqlClient;
using Devv.Core.UniDataTier;

namespace Yglu.BusinessLayer.Entities
{
	public class AdminLog : BaseEntity
	{
		#region Properties

		public String Message { get; set; }
		public String Page { get; set; }
		public DateTime DateRecorded { get; set;}

		public User User { get; set; }

		#endregion

		#region Constructor

		public AdminLog()
		{
			User = new User();
		}

		public AdminLog(SqlDataReader reader)
		{
			Construct(reader);
		}

		#endregion

		#region Methods

		public override void Load(SqlDataReader reader)
		{
			Id = DataHandler.GetInt32(reader, "AdminLog");
			Message = DataHandler.GetString(reader, "AdminLogMessage");
			Page = DataHandler.GetString(reader, "AdminLogPage");
			DateRecorded = DataHandler.GetDateTime(reader, "AdminLogDateRecorded");
			Active = DataHandler.GetBoolean(reader, "AdminLogActive");

			User = new User();
			User.Load(reader);
		}

		#endregion
	}
}